package com.qilu.pe.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.qilu.pe.R;
import com.qilu.pe.dao.bean.ItemSet;
import com.qilu.pe.dao.bean.OrderDetail;

import java.util.List;

/**
 * <br/>┏------------------------------------------
 * <br/>│Note:
 * <br/>│
 * <br/>┣------------------------------------------
 * <br/>│                 /) /)
 * <br/>│               ฅ(• ﻌ •)ฅ
 * <br/>│  Created by @author HaoKing on 2020/11/02 8:52.
 * <br/>│          www.muchenxinxi.com
 * <br/>│           www.nextdever.com
 * <br/>│           WeChat: NextDever
 * <br/>│             QQ: 773693552
 * <br/>│     QQ Group: Geek Chat 344386592
 * <br/>┗------------------------------------------
 */
public class ComboCardHolder {
    public Context mContext;
    public TextView vSetTitle;
    public RecyclerView vSetItemList;
    public OrderDetailSetItemListAdapter mSetItemAdapter;
    public List<ItemSet> mItems;
    public String orderId, orderStatus;

    public ComboCardHolder(Context context) {
        this.mContext = context;
    }

    public ComboCardHolder(Context context, String orderId, String orderStatus) {
        this.mContext = context;
        this.orderId = orderId;
        this.orderStatus = orderStatus;
    }

    public void setItem(View v, OrderDetail.Combo set) {
        vSetTitle = v.findViewById(R.id.vSetTitle);
        vSetItemList = v.findViewById(R.id.rcv_set);

        vSetTitle.setText(set.getName());
    }

    public void setSetItem(List<OrderDetail.Combo.Info> items) {
        mSetItemAdapter = new OrderDetailSetItemListAdapter(mContext, orderId, orderStatus);
        mSetItemAdapter.setDataList(items);
        vSetItemList.setLayoutManager(new LinearLayoutManager(mContext));
        vSetItemList.setAdapter(mSetItemAdapter);
    }

}
